package com.ruoyi.business.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import com.ruoyi.business.entity.bo.*;
import com.ruoyi.business.service.BusinessProcessService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.validate.MustNeed;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 业务相关流程
 *
 * @author zyb
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/process")
public class BusinessProcessController extends BaseController {


    private final BusinessProcessService businessProcessService;

    /**
     * 发起 工程款支付审核报表审批流程
     */
    @SaCheckLogin
    @PostMapping("/startGCKZHSHBBSPLCProcess")
    public R<Void> startGCKZHSHBBSPLCProcess(@Validated(MustNeed.class) @RequestBody gckzfshbbsplcBo bo) {
        return toAjax(businessProcessService.startGCKZHSHBBSPLCProcess(bo));
    }

    /**
     * 获取 工程款支付审核报表审批流程 预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getGCKZHSHBBSPLCPerson/{businessId}")
    public R<ProcessPersonBo> getGCKZHSHBBSPLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getGCKZHSHBBSPLCPerson(businessId));
    }

    /**
     * 发起 工序报验审批流程
     */
    @SaCheckLogin
    @PostMapping("/startGXBYSPLCProcess")
    public R<Void> startGXBYSPLCProcess(@Validated(MustNeed.class) @RequestBody GxbysplcBo bo) {
        return toAjax(businessProcessService.startGXBYSPLCProcess(bo));
    }

    /**
     * 获取 工序报验审批流程 预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getGXBYSPLCPerson/{businessId}")
    public R<ProcessPersonBo> getGXBYSPLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getGXBYSPLCPerson(businessId));
    }

    /**
     * 发起合同审批流程
     */
    @SaCheckLogin
    @PostMapping("/startHTSPProcess")
    public R<Void> startHTSPProcess(@Validated(MustNeed.class) @RequestBody htsplcBo bo) {
        return toAjax(businessProcessService.startHTSPProcess(bo));
    }
    /**
     * 发起合同变更审批流程
     */
    @SaCheckLogin
    @PostMapping("/startHTBGSPProcess")
    public R<Void> startHTBGSPProcess(@Validated(MustNeed.class) @RequestBody htsplcBo bo) {
        return toAjax(businessProcessService.startHTBGSPProcess(bo));
    }

    /**
     * 获取合同审批流程预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getHTSPLCPerson/{businessId}")
    public R<ProcessPersonBo> getHTSPLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getHTSPLCPerson(businessId));
    }
    /**
     * 获取合同审批流程预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getHTBGSPLCPerson/{businessId}")
    public R<ProcessPersonBo> getHTBGSPLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getHTBGSPLCPerson(businessId));
    }

    /**
     * 发起合同站点清单审批流程
     */
    @SaCheckLogin
    @PostMapping("/startHTZDQDSPProcess")
    public R<Void> startHTZDQDSPProcess(@Validated(MustNeed.class) @RequestBody htzdqdlcBo bo) {
        return toAjax(businessProcessService.startHTZDQDSPProcess(bo));
    }

    /**
     * 获取合同站点清单审批流程预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getHTZDQDSPPerson/{businessId}")
    public R<ProcessPersonBo> getHTZDQDSPPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getHTZDQDSPPerson(businessId));
    }

    /**
     * 发起开工预付款审批流程
     */
    @SaCheckLogin
    @PostMapping("/startKGYFKProcess")
    public R<Void> startKGYFKProcess(@Validated(MustNeed.class) @RequestBody kgyfklcBo bo) {
        return toAjax(businessProcessService.startKGYFKProcess(bo));
    }

    /**
     * 获取开工预付款审批流程预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getKGYFKLCPerson/{businessId}")
    public R<ProcessPersonBo> getKGYFKLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getKGYFKLCPerson(businessId));
    }

    /**
     * 发起 甲供材审批流程
     */
    @SaCheckLogin
    @PostMapping("/startJGCSPLCProcess")
    public R<Void> startJGCSPLCProcess(@Validated(MustNeed.class) @RequestBody jgcsplcBo bo) {
        return toAjax(businessProcessService.startJGCSPLCProcess(bo));
    }

    /**
     * 获取 甲供材审批流程 预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getJGCSPLCPerson/{businessId}")
    public R<ProcessPersonBo> getJGCSPLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getJGCSPLCPerson(businessId));
    }


    /**
     * 发起 甲供材报表审批流程
     */
    @SaCheckLogin
    @PostMapping("/startJGCBBSPLCProcess")
    public R<Void> startJGCBBSPLCProcess(@Validated(MustNeed.class) @RequestBody jgcsplcBo bo) {
        return toAjax(businessProcessService.startJGCBBSPLCProcess(bo));
    }


    /**
     * 获取 甲供材报表审批流程 预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getJGCBBSPLCPerson/{businessId}")
    public R<ProcessPersonBo> getJGCBBSPLCPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getJGCBBSPLCPerson(businessId));
    }

    /**
     * 发起 合同站点清单变更审批流程
     */
    @SaCheckLogin
    @PostMapping("/startHTZDQDBGSPProcess")
    public R<Void> startHTZDQDBGSPProcess(@Validated(MustNeed.class) @RequestBody htzdqdlcBo bo) {
        return toAjax(businessProcessService.startHTZDQDBGSPProcess(bo));
    }

    /**
     * 获取合同站点清单变更审批流程预设审批人
     */
    @SaCheckLogin
    @GetMapping("/getHTZDQDBGSPPerson/{businessId}")
    public R<ProcessPersonBo> getHTZDQDBGSPPerson(@PathVariable(value = "businessId", required = true) Long businessId) {
        return R.ok(businessProcessService.getHTZDQDBGSPPerson(businessId));
    }

}
